<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.situ.personal.entity.StudentNoHave"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		//设置  作用域
		// 1.字符串
		request.setAttribute("name", "lisi");
		session.setAttribute("name", "wangwu");
		//2.对象
		StudentNoHave student = new StudentNoHave(20,"LiuYiFei");
		session.setAttribute("student", student);
		// 集合 list<StudnetNoHave>
		List<StudentNoHave> list = new ArrayList();
		StudentNoHave stu1 = new StudentNoHave(30,"yaheihei");
		StudentNoHave stu2 = new StudentNoHave(22,"lalalal");
	%>
	
<!-- 1.获取普通字符串 -->
	<!-- JSP表达式获取字符串 -->
	<%=request.getAttribute("name")%><br>
	<%=session.getAttribute("name")%><br>	
	<!-- EL表达式 获取作用域  -->
	${requestScope.name}</br> <!-- 指定范围 request的作用域  -->
	${sessionScope.name}</br><!-- 指定范围 session的作用域  -->
	<!-- 
	如果字段名都叫name，默认取值范围 pageContext > request > session > application
	大部分情况不加取值范围，直接 ${字段名}
	--> 
	${name}</br>
	
<!-- 2.获取 对象 -->
	<%StudentNoHave stu = (StudentNoHave)session.getAttribute("student");%>
	<!-- JSP表达式 -->
	<%=stu.getAge() %><br>
	<%=stu.getName() %><br>
	<!-- EL表达式 -->
	${student.name}--${student.age} <!-- LiuYiFei--20 -->
</body>
</html>